package org.example.springboot.dao;

import org.apache.ibatis.annotations.*;
import org.example.springboot.model.Items;
import org.example.springboot.model.Users;

import java.util.List;

@Mapper
public interface UsersMapper {
    @Insert("insert into users(username, password) values(#{username},#{password})")
    int insertUser(@Param("username") String username, @Param("password") String password);


    @Select("select * from users where username = #{username}")
    List<Users> findUserByUserName(@Param("username")String username);

    @Select("select exists(select * from users where username = #{username} and password=#{password})")
    int loginVerify(@Param("username")String username,@Param("password")String password);

}
